package com.petadoption.serverclient.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.petadoption.serverclient.entity.Pet;
import com.petadoption.serverclient.mapper.PetMapper;
import com.petadoption.serverclient.service.IPetService;
import com.petadoption.serverclient.vo.PetVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 宠物服务实现类
 * </p>
 *
 * @author 汪仕杰
 * @since 2023-08-28
 */
@Service
public class PetServiceImpl extends ServiceImpl<PetMapper, Pet> implements IPetService {

    @Resource
    private PetMapper petMapper;

    @Override
    public List<PetVO> findPetAll() {
        return petMapper.findPetAll();
    }

    @Override
    public List<PetVO> findPet(String parameter) {
        return petMapper.findPet(parameter);
    }

    @Override
    public PetVO findPetById(int id) {
        return petMapper.findPetById(id);
    }

    @Override
    public int delById(Integer id) {
        return petMapper.deleteById(id);
    }

    @Override
    public int addPet(Pet pet) {
        return petMapper.insert(pet);
    }
}
